package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.kaishengit.pojo.Files;
import com.kaishengit.pojo.Filetype;

@Repository
public class FileDao extends BaseDao<Files,Integer>{

	@SuppressWarnings("unchecked")
	public List<Files> findByFiletype(Filetype filetype) {
		String hql = "from Files where filetype=:filetype";
		Query query = getSession().createQuery(hql);
		query.setParameter("filetype",filetype);
		return query.list();
	}
	
}
